﻿<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path;
    request.setAttribute("basePath", basePath);
%>
<html lang="zh">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"/>
    <title>数据列表 - bootstrap中文后台管理系统模板</title>
    <base href="${basePath}/static/admin/">
    <link rel="icon" href="favicon.ico" type="image/ico">
    <meta name="keywords" content="后台模板,后台管理系统,HTML模板">
    <meta name="description" content="基于Bootstrap的后台管理系统模板">
    <meta name="author" content="www.bootstrapmb.com">
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="css/fonts.css" rel="stylesheet">
    <link href="css/style.css" rel="stylesheet">
</head>

<body>
<!--页面主要内容-->
<main class="ftdms-layout-content">

    <div class="container-fluid" style="margin-bottom:90px;">

        <div class="row" style="margin-top:15px;">
            <div class="col-lg-12">
                <div class="card">
                    <div class="card-toolbar clearfix">
                        <form class="pull-right search-bar" method="get" action="#!" role="form">
                            <div class="input-group">
                                <div class="input-group-btn">
                                    <a class="btn btn-primary m-r-5 submenuitem"
                                       href="../../user/toinvitationadd.action" data-id="link552" data-index="552">
                                        新增</a>
                                    <input type="hidden" name="search_field" id="search-field" value="title">
                                    <button class="btn btn-default dropdown-toggle" id="search-btn"
                                            data-toggle="dropdown" type="button" aria-haspopup="true"
                                            aria-expanded="false">
                                        标题 <span class="caret"></span>
                                    </button>
                                    <ul class="dropdown-menu">
                                        <li><a tabindex="-1" href="" data-field="cat_name">查询</a></li>
                                    </ul>
                                </div>
                                <input type="text" class="form-control" value="" name="keyword"
                                       placeholder="请输入名称">


                            </div>
                        </form>
                        <div class="toolbar-btn-action">
                            <c:if test="${createUser.rId==2}">
                                <a class="btn btn-success m-r-5 submenuitem"
                                   href="${pageContext.request.contextPath}/admin/invitationcheck.action"
                                   data-id="link553" data-index="553"> 审核通过</a>
                                <a class="btn btn-warning m-r-5 submenuitem"
                                   href="../../admin/invitationchecktwo.action" data-id="link554" data-index="554">
                                    未审核</a>
                                <a class="btn btn-danger m-r-5 submenuitem"
                                   href="../../admin/invitationcheckthree.action" data-id="link555" data-index="555">审核不通过</a>
                            </c:if>
                        </div>
                    </div>
                    <div class="card-body">

                        <div class="table-responsive">
                            <form id="form1" action="invitationdelete.action" method="post">
                                <table class="table table-bordered">
                                    <thead>
                                    <tr>
                                        <th width="5">
                                            <label class="ftdms-checkbox checkbox-primary">
                                                <input type="checkbox" id="check-all"><span></span>
                                            </label>
                                        </th>
                                        <th>编号</th>
                                        <th style="width: 15%">标题</th>
                                        <th style="width: 35%">内容</th>
                                        <th>编号</th>
                                        <%--                          <th>时间</th>--%>
                                        <th>帖子状态</th>
                                        <th>帖子类型</th>
                                        <%--                          <th>是否已删除</th>--%>

                                        <th>操作</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <c:forEach var="invitation" items="${page.pageInfo.list}">
                                        <tr>
                                            <td>
                                                <label class="ftdms-checkbox checkbox-primary">
                                                    <input type="checkbox" name="invitationId"
                                                           value="${invitation.invitationId}"><span></span>
                                                </label>
                                            </td>
                                            <td>${invitation.invitationId}</td>
                                            <td>${invitation.title}</td>
                                            <td>${invitation.invitationContent}</td>
                                            <td>${invitation.uId}</td>
                                                <%--                          <td><fmt:formatDate value="${invitation.createDate}" pattern="yyyy-MM-dd"/></td>--%>
                                            <td>${invitation.isName}</td>
                                            <td>${invitation.itName}</td>
                                                <%--                          <c:if test="${invitation.isDelete==0}">--%>
                                                <%--                            <td>正常</td>--%>
                                                <%--                          </c:if>--%>
                                                <%--                          <c:if test="${invitation.isDelete==1}">--%>
                                                <%--                            <td><button href="isdelete.action?isdelete=0">恢复</button></td>--%>
                                                <%--                          </c:if>--%>
                                            <td>
                                                <div class="btn-group">
                                                        <%--                                <a class="btn btn-xs btn-default submenuitem" href="../../admin/toinvitationupdate.action?invitationId=${invitation.invitationId}" target= "_self" title="编辑" data-toggle="tooltip"><i class="ftsucai-edit-2"></i></a>--%>
                                                    <a class="btn btn-xs btn-default submenuitem"
                                                       onclick="delectone(${invitation.invitationId})" target="_self"
                                                       title="删除" data-toggle="tooltip"><i class="ftsucai-del-2"></i></a>

                                                </div>
                                            </td>

                                        </tr>
                                    </c:forEach>
                                    </tbody>
                                </table>
                            </form>
                        </div>
                        <ul class="pagination">
                            <li><a href="${pageContext.request.contextPath}${page.servletUrl}">首页</a></li>
                            <li>
                                <a href="${pageContext.request.contextPath}${page.servletUrl}?pageNum=${page.pageInfo.pageNum-1}&${page.condition}">上一页</a>
                            </li>
                            <c:forEach begin="${page.pageInfo.navigateFirstPage}"
                                       end="${page.pageInfo.navigateLastPage}" var="a">
                                <li><a href="${pageContext.request.contextPath}${page.servletUrl}?pageNum=${a}">${a}</a>
                                </li>
                            </c:forEach>
                            <li>
                                <a href="${pageContext.request.contextPath}${page.servletUrl}?pageNum=${page.pageInfo.pageNum==page.pageInfo.pages?page.pageInfo.pageNum:page.pageInfo.pageNum+1}">下一页</a>
                            </li>
                            <li>
                                <a href="${pageContext.request.contextPath}${page.servletUrl}?pageNum=${page.pageInfo.pages}">尾页</a>
                            </li>
                        </ul>


                    </div>
                </div>
            </div>

        </div>

    </div>

</main>
<!--End 页面主要内容-->

<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/bootstrap.js"></script>
<script type="text/javascript" src="js/perfect-scrollbar.min.js"></script>
<script type="text/javascript" src="js/main.min.js"></script>
<script type="text/javascript">
    $(function () {
        $('.search-bar .dropdown-menu a').click(function () {
            var field = $(this).data('field') || '';
            $('#search-field').val(field);
            $('#search-btn').html($(this).text() + ' <span class="caret"></span>');
        });
    });

    function delectone(invitationId) {
        confirm("确认要删除吗？")
        window.location.href = "${pageContext.request.contextPath}/invitationdelete.action?invitationId=" + invitationId
    };


</script>
</body>
</html>